package com.cjs.simpleFactory;

public class Factory {
	public static Fruit getFruit(String type){
		try {
			Class a =  Class.forName("com.cjs.simpleFactory." + type);
			return (Fruit)a.newInstance();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		
		return null;
		
	}
}
